package com.wms.controller.open;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wms.controller.admin.BaseController;
import com.wms.entity.Blog;
import com.wms.service.BlogService;
import com.wms.validation.Add;
import com.wms.validation.Update;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/open/blog")
@RestController("openBlogController")
public class BlogController extends BaseController {

    @Autowired
    private BlogService blogService;


    @RequestMapping("/list")
    public Object list(Page<Blog> page) {
        IPage<Blog> iPage = blogService.page(page);
        return success(iPage);
    }

    @RequestMapping("/add")
    public String add(@Validated({Add.class}) @RequestBody Blog blog) {
        return "success";
    }

    @RequestMapping("/update")
    public String update(@Validated({Update.class}) @RequestBody Blog blog) {
        return "success";
    }



}
